package net.fdukedom.epicurus.messaging;

/**
 * Exception that describes situation when addressee for message was not found.
 *
 * @author Dmitry Y. Kochelaev
 */
public class AddresseeNotFoundException extends Exception {

    private final String addressee;

    /**
     * Constructs a new exception with the specified detail message.  The
     * cause is not initialized, and may subsequently be initialized by
     * a call to {@link #initCause}.
     *
     * @param addressee the detail message. The detail message is saved for
     *                later retrieval by the {@link #getMessage()} method.
     */
    public AddresseeNotFoundException(String addressee) {
        super("Addressee not found: " + addressee);
        this.addressee = addressee;
    }

    /**
     * Returns addressee, which wasn't found.
     *
     * @return addressee, which wasn't found
     */
    public String getAddressee() {
        return addressee;
    }
}
